-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: github-releases fill newDigest #10931
Conversation
I'd like to fill `newDigest` in the values returned here, and I think the best approach to calculating the digest will require knowing the previous value. This initial commit wires the current version+digest (they were already provided, but masked by types), and the logs the values.
👋 I'm interested in some feedback on this injection point before I follow up with additional unit tests. A draft PR seemed easier than a discussion, please let me know if you'd strictly prefer discussions. |
@thepwagner thanks for the PR. It's a little hacky to populate newDigest from just one asset, but I like the idea of using the current digest to try to work out which asset is in use. I'm not sure that
Therefore we normally only return digests from renovate/lib/datasource/types.ts Line 63 in 7842ff7
The Could you take a look at that and confirm if I've understood your intention correctly and if |
@rarkins that sounds much more reasonable, thank you for the feedback! I'd started out building on I'm going to close this PR as an abandoned path. If I have any questions about the |
Changes:
This modifies the
github-releases
datasource to fill thenewDigest
field according to checksum files as release assets.To accomplish this, the current release and digest are passed as parameters to
getReleases()
:<5KB
assets are downloaded from the current release in an attempt to find the relevant checksum asset for the project (e.g.SHASUMS
,SHASUMS.txt
,${artifact}.sha256
).Context:
I built the version of this functionality that I care about in https://github.com/thepwagner/action-update-dockerurl ; but the Renovate's
regexManager
handles 90% of the functionality I'm interested in! This algorithm is based on updatedHash from that project. I skipped the bit that fetches full asset files as that would be very expensive in thegetReleases()
context.I'm using test cases from https://github.com/thepwagner/renovate-github-releases-digests .
Closes #7928
Documentation (please check one with an [x])
How I've tested my work (please tick one)
I have verified these changes via: